﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>ADDIVITY</title>
		<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
		<link href="css/jquery.ennui.contentslider.css" rel="stylesheet" type="text/css" media="screen,projection" />
		<script type="text/javascript">
			function validateForm(){
				var x=document.forms["form_edit_passwd"]["pid"].value;
				if(x==null || x==""){
					alert("กรูณากรอกหมายเลขที่บัตรประชาชน");
					return false;
				}else{
					if(!checkID(document.forms["form_edit_passwd"]["pid"].value)){
						alert('กรูณากรอกหมายเลขที่บัตรประชาชนที่ถูกต้อง');
						return false;
					}
					//return true;
				}
				var x=document.forms["form_edit_passwd"]["uname"].value;
				if(x==null || x==""){
					alert("กรุณากรอกข้อมูลชื่อผู้ใช้");
					return false;
				}else{
					//return true; 
				}
				var x=document.forms["form_edit_passwd"]["pname"].value;
				if(x==null || x==""){
					alert("กรุณากรอกข้อมูลรหัสผ่าน");
					return false;
				}else{
					var x0=document.forms["form_edit_passwd"]["pname"].value;
					var x1=document.forms["form_edit_passwd"]["rpname"].value;
					if(x0!=x1){
						alert("กรูณากรอกข้อมูลรหัสผ่านให้ตรงกัน");
						return false;
					}else{
						return true; 
					}
				}
			}
			function checkID(id){
				if(id.length != 13) 
					return false;
				for(i=0, sum=0; i < 12; i++)
					sum += parseFloat(id.charAt(i))*(13-i); 
				if((11-sum%11)%10!=parseFloat(id.charAt(12)))
					return false; 
				return true;
			}
		</script>
	</head>
	<body>
		<div id="templatemo_header_wrapper">
			<div id="templatemo_header">
				<div id="site_title">
					<h1>
						<a href="" target="_parent">
							<img src="images/logo.jpg" alt="Logo" />
							<!-- <span>free website templates</span> -->
						</a>
					</h1>
				</div>
				<div id="search_box">
					<?php include("./module/login_top.php"); ?>
				</div>
				<div class="cleaner"></div>
			</div>
			<div id="templatemo_menu">
				<ul>
					<?php include("./module/menu_ber_top.php"); ?>
				</ul>
			</div>
			<div id="templatemo_banner">
				<div id="one" class="contentslider">
					<div class="cs_wrapper">
						<div class="cs_slider">
							<?php
								$i=1;
								while($i<5){
									echo "<div class='cs_article'>";
									echo "<div class='left'>";
									echo "<h2>ADDIVITY News</h2>";
									echo "<p>
											News bra bra bra. News bra bra bra. News bra bra bra. News bra bra bra. 
											News bra bra bra. News bra bra bra. News bra bra bra. News bra bra bra. 
											News bra bra bra. News bra bra bra. News bra bra bra. News bra bra bra. 
											News bra bra bra. News bra bra bra. News bra bra bra. 
										  </p>";
									echo "<div class='button'><a href='#'>Read more</a></div>";
									echo "</div>";
									echo "<div class='right'>";
									echo "<a href='#' target='_parent'><img src='' alt='Image' /></a>";
									echo "</div>";
									echo "</div>";
									$i++;
								}
							?>
						</div>
					</div>
				</div>
				<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
				<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
				<script type="text/javascript" src="js/jquery.ennui.contentslider.js"></script>
				<script type="text/javascript">
					$(function() {
						$('#one').ContentSlider({
							width : '920px',
							height : '200px',
							speed : 800,
							easing : 'easeInOutBack'
						});
					});
				</script>
				<script src="js/jquery.chili-2.2.js" type="text/javascript"></script>
				<script src="js/chili/recipes.js" type="text/javascript"></script>
				<div class="cleaner"></div>
			</div>
		</div>
		<div id="templatemo_content_wrapper_outer">
			<?php
				error_reporting (E_ALL ^ E_NOTICE);
				include("./config/conn_database.php");
			?>
			<div id="templatemo_content_wrapper_inner">
				<div id="templatemo_content_wrapper">
					<div id="templatemo_content">
						<h2>Register Member</h2>
						<p>
							<form name="form_edit_passwd" action="mem_edit_passwd_sql.php" method="post" onsubmit="return validateForm()">
							<table border="0" width="100%">
								<tr>
									<td width="35%">หมายเลขที่บัตรประชาชน (Personal ID)</td>
									<td><input type="text" name="pid" size="55" maxlength="13" /></td>
								</tr>
								<tr>
									<td width="35%">ชื่อผู้ใช้ (Username)</td>
									<td><input type="text" name="uname" size="55" maxlength="255" /></td>
								</tr>
								<tr>
									<td width="35%">รหัสผ่านใหม่ (New Password)</td>
									<td><input type="password" name="pname" size="55" maxlength="255" /></td>
								</tr>
								<tr>
									<td width="35%">ยืนยันรหัสผ่านใหม่ (Re-Password)</td>
									<td><input type="password" name="rpname" size="55" maxlength="255" /></td>
								</tr>
								<tr>
									<td width="35%" align="right"><input type="submit" name="Submit" value="Submit" alt="Submit" /></td>
									<td><input type="button" name="Cancel" value="Cancel" onclick="window.location = 'index.php' " /></td>
								</tr>
								
							</table>
							</form>
						</p>
					</div>
					<div id="templatemo_sidebar">
						<div class="section_rss_twitter">
							<?php
								$i=1;
								while($i<5){
									echo "<div class='rss_twitter twitter'>";
									echo "<a href='#' target='_parent'>Banner Name<span>Banner</span></a>";
									echo "</div>";
									echo "<div class='margin_bottom_20'></div>";
									$i++;
								}
							?>
						</div>
						<div class="cleaner"></div>	
					</div>
					<div class="cleaner"></div>
				</div>
			</div>
		</div>
		<div id="templatemo_footer_wrapper">
			<div id="templatemo_footer">
				<ul class="footer_menu">
					<?php include("./module/menu_ber_top.php"); ?>
				</ul>			
				Copyright © 2048 <a href="#">ADDIVITY</a> | 
				Designed by <a href="http://www.templatemo.com" target="_parent">templatemo.com</a>			
			</div>
		</div>
	</body>
</html>
<?php
	mysql_close($objConnect);
?>
